package leetcode100;

import java.util.Scanner;

/**
 * @author shkstart
 * 密码按如下规则进行计分，并根据不同的得分为密码进行安全等级划分。
 * @create 2022-12-01-22:04
 */
public class Meme10_2 {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        String str = scanner.nextLine();
        int sum1 = getLen(str);
        int sum2 = getChar(str);
        int sum3 = getNum(str);
        int sum4 = getSym(str);

        int sum = 0;
        if (sum2 == 20 && sum3 >= 1 && sum4 >= 1) {
            sum = sum1 + sum2 + sum3 + sum4 + 5;
        } else if (sum2 == 10 && sum3 >= 1 && sum4 >= 1) {
            sum = sum1 + sum2 + sum3 + sum4 + 3;
        } else if (sum2 == 10 && sum3 >= 1 && sum4 == 0) {
            sum = sum1 + sum2 + sum3 + sum4 + 2;
        } else {
            sum = sum1 + sum2 + sum3 + sum4;
        }
        if (sum >= 90) {
            System.out.println("VERY_SECURE");
        } else if (sum >= 80) {
            System.out.println("SECURE");
        } else if (sum >= 70) {
            System.out.println("VERY_STRONG");
        } else if (sum >= 60) {
            System.out.println("STRONG");
        } else if (sum >= 50) {
            System.out.println("AVERAGE");
        } else if (sum >= 25) {
            System.out.println("WEAK");
        } else if (sum >= 0) {
            System.out.println("VERY_WEAK");
        }


    }

    private static int getSym(String str) {

        int count = 0;
        for (int i = 0; i < str.length(); i++) {
            char ch = str.charAt(i);
            if (!(ch >= 48 && ch <= 57) && !(ch <= 90 && ch >= 65) && !(ch >= 97 && ch <= 122)) {
                count++;
            }
        }
        if (count == 0) {
            return 0;
        } else if (count == 1) {
            return 10;
        } else {
            return 25;
        }

    }

    private static int getNum(String str) {

        int count = 0;
        for (int i = 0; i < str.length(); i++) {
            char ch = str.charAt(i);
            if (ch >= 48 && ch <= 57) {
                count++;
            }
        }
        if (count == 0) {
            return 0;
        } else if (count == 1) {
            return 10;
        } else {
            return 20;
        }

    }

    private static int getChar(String str) {
        int x = 0;
        int y = 0;
        for (int i = 0; i < str.length(); i++) {
            char ch = str.charAt(i);
            if (ch <= 90 && ch >= 65) {
                x = 1;
            }else if (ch >= 97 && ch <= 122) {
                y = 1;
            }
        }
        if (x + y == 0) {
            return 0;
        } else if (x + y == 1) {
            return 10;
        } else {
            return 20;
        }

    }

    private static int getLen(String str) {
        if (str.length() <= 4) {
            return 5;
        } else if (str.length() >= 8) {
            return 25;
        } else if(str.length()<=7&&str.length()>=5){
            return 10;
        }
        return 0;
    }
}
